﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using System.Windows;

namespace PedesTrainProject.Grid
{
    [Serializable()]
    public class Tile : ISerializable
    {
        private Road road;

        public Road Road
        {
            get { return road; }
            set { road = value; }
        }

        public Tile(Road _road)
        {
            road = _road;
        }

        public Tile()
        {
        }

        #region Serialize
        public Tile (SerializationInfo info, StreamingContext ctxt)
        {
            this.road = (Road)info.GetValue("Road", typeof(Road));
            //this.elements = (List<Element>)info.GetValue("Elements", typeof(List<Element>));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("Road", this.road);
         //   info.AddValue("Elements", this.elements);
        }
        #endregion
    }
}
